package com.example.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

@lombok.Getter
@lombok.AllArgsConstructor
public enum StatusEnum {
    TBD(0, "待处理"),
    ALLOW(-1, "允许"),
    DENY(1, "禁止");

    @EnumValue
    private Integer code;

    private String desc;

    static public StatusEnum getEnumByCode(Integer status) {
        if (status > 0) {
            return DENY;
        } else if (status < 0) {
            return ALLOW;
        } else {
            return TBD;
        }
    }
}
